home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / monochrome.swf / scripts / frame_25 / PlaceObject2_477_231 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-26  |  1.0 KB  |  41 lines

  1. onClipEvent(enterFrame){
  2.    if(_name != "shipS")
  3.    {
  4.       xspeed = speed * Math.sin((_rotation * -1 + 180) * 0.017453292519943295);
  5.       yspeed = speed * Math.cos((_rotation * -1 + 180) * 0.017453292519943295);
  6.       _X = _X + xspeed;
  7.       _Y = _Y + yspeed;
  8.       _rotation = Math.atan2(_X - _root.ship._x,_Y - _root.ship._y) / 0.017453292519943295 * -1;
  9.       xx = random(30);
  10.       if(_X < -100 || _X > 650 || _Y < -100 || _Y > 500 || _root.rem == true)
  11.       {
  12.          removeMovieClip(this);
  13.       }
  14.       var i = 0;
  15.       while(i <= 20)
  16.       {
  17.          if(sh.harea.hitTest(_root["hmn" + i]))
  18.          {
  19.             life -= _root["hmn" + i].dmg;
  20.             sh.play();
  21.             removeMovieClip(_root["hmn" + i]);
  22.          }
  23.          i++;
  24.       }
  25.       if(_root.ship.sh.hitTest(_X,_Y,false))
  26.       {
  27.          play();
  28.          _root.ship.play();
  29.       }
  30.       if(life <= 0)
  31.       {
  32.          play();
  33.       }
  34.       yy = random(100);
  35.       if(yy == 0)
  36.       {
  37.          _root.fire(this);
  38.       }
  39.    }
  40. }
  41.